package com.qys.livesMall.app.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qys.livesMall.app.user.model.dto.sys.RechargStatisticsPage;
import com.qys.livesMall.app.user.model.dto.sys.SysHomeStatisticsDTO;
import com.qys.livesMall.app.user.model.dto.sys.WithdrawalsStatisticsPage;
import com.qys.livesMall.app.user.model.entity.H2AppUserRechargeWithdrawals;
import com.qys.livesMall.app.user.model.vo.WithdrawalsStatisticsVO;
import com.qys.livesMall.app.user.model.vo.sys.AppUserRWRankingVO;
import com.qys.livesMall.app.user.model.vo.sys.RechargStatisticsVO;
import com.qys.livesMall.framework.view.BaseQuery;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 用户充值 Mapper 接口
 * </p>
 *
 * @author dp
 * @since 2023-04-27
 */
public interface H2AppUserRechargeWithdrawalsMapper extends BaseMapper<H2AppUserRechargeWithdrawals> {

    Page<RechargStatisticsVO> rechargePage(@Param("page") Page<RechargStatisticsVO> page, @Param("pageDTO") RechargStatisticsPage pageDTO);
    Page<WithdrawalsStatisticsVO> withdrawalsPage(@Param("page") Page<WithdrawalsStatisticsVO> page,
                                                  @Param("code") String code,
                                                  @Param("pageDTO") WithdrawalsStatisticsPage pageDTO);

    List<H2AppUserRechargeWithdrawals> getYesterday();

    Integer WithdrawalstByUserIds(@Param("list") List<String> list,@Param("num") int num);

    BigDecimal getAuditWithdrawal(@Param("dto") SysHomeStatisticsDTO dto);

    BigDecimal getInitiateWithdrawal(Integer userSysType);

    List<H2AppUserRechargeWithdrawals> getTodayData(Integer userSysType);

    Integer gettotalRechargePeoplecount(Integer userSysType);

    BigDecimal getAuditWithdrawalByUserids(@Param("userids")List<Long> userids);

    BigDecimal getAuditShopWithdrawalByUserids(@Param("userids") List<Long> userids);

    List<Long> getChildInfo(@Param("userIdList") List<Long> userIdList);

    List<String> getUserRechargeList(@Param("userids") List<String> userids);

    /**
     * 充值的总金额
     * @param userIdAll
     * @return
     */
    BigDecimal getRechargeAmount(@Param("userIdAll") List<Long> userIdAll);

    Integer getRechargeCount(Long userid);
    /**
     * 提现的总金额
     * @param userIdAll
     * @return
     */
    BigDecimal getthreewithdrawalAmount(@Param("userIdAll") List<Long> userIdAll);

    /**
     * 复冲的总金额
     */
    BigDecimal getTeamRechargeAmount(@Param("subordinateUserIds") List<String> subordinateUserIds);

    List<RechargStatisticsVO> rechargeList(@Param("pageDTO") RechargStatisticsPage pageDTO);

    /**
     * 满足充值金额的总人数
     * @param userIdAll
     * @param rechargeAsk
     * @return
     */
    Integer getSatisfyRechargeNmu(@Param("userIdAll") List<Long> userIdAll,@Param("rechargeAsk") BigDecimal rechargeAsk);

    List<H2AppUserRechargeWithdrawals> getDyaWithdrawal(String userId);

    List<H2AppUserRechargeWithdrawals> getWeekWithdrawal(String id);

    Page<AppUserRWRankingVO> rwrankingPage(@Param("page") Page<AppUserRWRankingVO> page,@Param("baseQuery") BaseQuery baseQuery);

    List<H2AppUserRechargeWithdrawals> getYesterdayRwDate(Integer userSysType);
}
